﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Web.Hosting;


namespace UtilitiesMvcUI.FixKendo
{
    public class CopyKendoWithout_Min
    {
        public static void copyKendoFiles(string directory)
        {
            string[] files = Directory.GetFiles(directory,"*.min*");
            for (int i = 0; i < files.Length; i++)
            {
                File.Copy(files[i], files[i].Replace(".min", ""),true);
            }
            string[] SubDirectories = Directory.GetDirectories(directory);
            for (int i = 0; i < SubDirectories.Length; i++)
            {
                copyKendoFiles(SubDirectories[i]);
            }
        }
        public static void fix() 
        {
            copyKendoFiles(WebHelper.Helpers.UrlHelper.GetPhysicalPath("~/content/kendo"));
            copyKendoFiles(WebHelper.Helpers.UrlHelper.GetPhysicalPath("~/scripts/kendo"));
        }
    }
}